#ifndef __GUISYS_H__
#define __GUISYS_H__


#include "..\pcommon\config.h"
#include <windows.h>
#include "..\game\p_shared.h"
#include "define.h"
#include "..\pcommon\ConfigDataDef.h"
#include "..\pcommon\zone.h"
#include <ddraw.h>

#define API_VERSION 3

typedef struct
{
	/* if api_version is different, the dll cannot be used */
	int		 api_version;

	/* fetching configuration */
	void	 (*Get_Config)(shooter_ptr, target_ptr);

	/* main GUI interface */
	pboolean (*Pre_GUI_Init)(void);

	/* to delete global pointer of configuration data */
	void	 (*Drop_Shooter_Ptr)(void);
	void	 (*Drop_Target_Ptr)(void);
	
} guiexport_t;

/*
 * these are the functions imported by the refresh module
 */
typedef struct
{
	HINSTANCE global_hInstance;
	shooter_ptr pShooter;

	void	(*Sys_Error)(char*, ...);
	void	(*Sys_Printf)(char*, ...);

	zone_t* (*Get_Zone)(void);
	void*	(*zm)(zone_t*, int);
	void	(*zf)(zone_t*, void*);
	void	(*zs)(zone_t*);

	IDirectDrawSurface7* (*Load_Bitmap)(IDirectDraw7*, LPCSTR, int, int);
	HRESULT (*ReLoad_Bitmap)(IDirectDrawSurface7*, LPCSTR);
} guiimport_t;

#define Call_(func, param2) (func)(g_gui_imp.Get_Zone(), (param2))

/* this is the only function actually exported at the linker level */
typedef	DLLFUNCTION guiexport_t	(*GetGUIAPI_t) (guiimport_t);


#endif